/*
 * @Author: silence
 * @Date: 2022-05-14 11:39:53
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-07-12 10:32:46
 * @Description: 应用信息-单例类
 */
import 'dart:io';

import 'package:flutter/material.dart';

/// app id
const String AppId = '3vx8id0t8kf8jq4y6u3y';
const String AppKey = '0khtg1wnffozyv1vpuhq7f35ok06wjyk';
/// host
const String BaseUrl = 'https://gapi.kadianshipin.com/';
const String convertUrl = 'https://api.aspose.cloud';
/// 请求每页数据的个数
const int PageLimit = 10; //16;
const int RequestTimeout = 120000;
/// app id
const bool kForTest = false;
/// jPUSH
const String kJpushAppId = "d80cb46d7d67a4ab87d0a310";
/// app名称
const String APP_NAME = '查妆助手';
/// 是否同意版本协议
const String APP_VERSION_AGREE = 'versionAgree';
/// 是否显示同意版本协议弹窗
const bool SHOW_VERSION_AGREE = true;
// /**客服QQ */
// final String QQ_CONSULTANCY = '3597846300';
/// 设置代理地址

const String authKey = "Authorization";
/// bundleid
const String kIOSAppId = "1606687293";
const String kAndroidPackageId = "com.csxm.redenvelope";
const String kIOSBundleId = "com.csxm.redenvelope";
final String kAppBundleId = Platform.isIOS ? kIOSBundleId : kAndroidPackageId;

/// app分享地址
const String APP_SHARE_URL =
    'https://qrcode.changshaxiemeng.com/download/10002.html';

/// 用户协议
final String PROTOCOL_USER =
    'https://gapi.kadianshipin.com/storage/upload/protocol/${AppId}_user.html';

/// 支持协议
final String PROTOCOL_SUPPORT =
    'https://gapi.kadianshipin.com/storage/upload/protocol/${AppId}_support.html';

/// 会员服务协议
final String PROTOCOL_MEMBER =
    'https://gapi.kadianshipin.com/storage/upload/protocol/${AppId}_member.html';

/// 隐私政策协议
final String PROTOCOL_PRIVACY =
    'https://gapi.kadianshipin.com/storage/upload/protocol/${AppId}_privacy.html';

/// 隐私政策协议
final String Cancellation_Url =
    'https://gapi.kadianshipin.com/storage/upload/protocol/${AppId}_logoff.html';

/// 关于批号
final String Batchno_Url =
    'https://gapi.kadianshipin.com/storage/upload/protocol/${AppId}_batchno.html';

class AppInfo {
  // 创建静态实例变量
  static final AppInfo _instance = AppInfo._internal();

  // 工厂方法
  factory AppInfo() => _instance;

  // 私有构造方法
  AppInfo._internal();

  // VIP提示文案配置
  Map<String, dynamic>? vip_prompt_wenan;

  // 实名认证开关
  bool? needCertification;

  // 账号注销冷静期天数
  int? logoff_calm_days;

  /// 客服QQ
  String? qqService;

  AppInfo init(Map<String, dynamic> vip_prompt_wenan, bool needCertification,
      int logoff_calm_days) {
    _instance.vip_prompt_wenan = vip_prompt_wenan;
    _instance.needCertification = needCertification;
    _instance.logoff_calm_days = logoff_calm_days;

    return _instance;
  }

  /// 是否有推送权限
  static bool notificationPerm = true;

  /// 设备注册ID(推送使用)
  static String registrationId = '';

  /// 是否需要获取启动消息，默认需要
  static bool launchAppGetNotification = true;
}
